//
//  bleIOSSdk.h
//  bleIOSSdk
//
//  Created by 董海伟 on 2019/2/6.
//  Copyright © 2019 董海伟. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BabyBluetooth.h"
#import "DataInfoOC.h"

enum {
    ERR_SUCCESS = 0,
    ERR_FAILED,
    ERR_CAN_SENDDATA,
};

@protocol bleIOSSdkDelegate <NSObject>
-(void)onConnec:(int)retCode;
-(void)onSendDataResult:(int)retCode with:(DataInfoOC*)dataInfoOC;
-(void)onRecvBleData:(NSData*) businessData with:(DataInfoOC*)dataInfoOC;
@end

@interface bleIOSSdk : NSObject
@property(nonatomic, assign) id<bleIOSSdkDelegate> delegate;

- (BabyBluetooth*) getBluetoothPtr;
- (void) initSdk: (NSString *) strHzkFileName;
- (void) unInitSdk;

- (void) connectDevice: (CBPeripheral *)currPeripheral;
- (void) sendData: (NSData *) businessData withTid: (char) tid withSid: (char) sid;

+ (NSData *) converHexStrToData: (NSString *) str;

@end
